package org.example.pattern.strategy;

public class ValidateUtil {


    public static <T> Result<T> validate(Strategy ... strategy)
    {
        Result<T> rs = Result.success(null);
        for (Strategy s : strategy)
        {
            Result<T> tmp = s.validate();
            if (tmp.getCode() != 200)
            {
                rs = tmp;
                break;
            }
        }
        return rs ;
    }
}
